<!DOCTYPE HTML>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"   %>
	
	<%@ page import="java.util.Properties" %> 
        <%@ page import="java.util.List" %> 
        <%@ page import="java.util.Iterator" %> 
        <%@ page import="java.util.Arrays" %> 
        <%@ page import="java.io.FileInputStream" %> 
        <%@ page import="com.baidu.ueditor.upload.Uploader" %> 
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	//基本路径
	String path = request.getContextPath();
%>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>ueditor demo</title>
<jsp:include page="/com/inc.jsp"></jsp:include>
</head>

<body>
	<div class="container">

		<jsp:include page="/com/nav.jsp"></jsp:include>
		<div>
			<div>标题</div>
			<div>
				<input id="title">
			</div>
		</div>
		<div>
			<div>内容</div>
			<div>
			
			<form  id="myBlogSubmit" method="post">
				<!-- 加载编辑器的容器 -->
				
				<script id="myEditor"  type="text/plain" name="content" style="height: 350px">
    		    
 				</script>
 			</form>
 			<div><input type="button" onclick="myBlogSubmit()" value="提交"></div>
				<!-- 配置文件 -->
				<script type="text/javascript"
					src="<%=path%>/jscss/ueditor/ueditor.config.js"></script>
				<!-- 编辑器源码文件 -->
				<script type="text/javascript"
					src="<%=path%>/jscss/ueditor/ueditor.all.js"></script>
				<!-- 实例化编辑器 -->
				<script type="text/javascript">
				var editor = new baidu.editor.ui.Editor();
			    editor.render("myEditor");
				</script>
			</div>
		</div>
	</div>
	
	

<script type="text/javascript">

function myBlogSubmit(){
	debugger;	
	var content1 = UE.getEditor('myEditor',{allowDivTransToP: false})
  					  .getContent();
//   					  .replace(",","/,").replace(";","/;");
		  
	alert(content1);
	var title1 =$("#title").val();
	var submit=$("#myBlogSubmit");
	var urls ='${webRoot}/basic/myBlogSubmit.do';
	$.post(urls,{content:content1,title:title1});
}


</script>
</body>

</html>